package aspect;

import java.io.File;
import java.io.PrintWriter;

//@Aspect
public class Logging {

	File file = null;
	PrintWriter writer = null;

	// @After("execution(* server.Client.*(..))")
	public void start() {
		try {

			file = new File("log.txt");

			if (file.exists())
				file.delete();

			file.createNewFile();
			writer = new PrintWriter(file);
			writer.println("Game Started!");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public void saveCash(Integer id, Integer cash) {

		writer.println("Player " + id.toString() + "cash: " + cash.toString());
	}

	public void saveBet(Integer id, Integer bet) {

		writer.println("Player " + id.toString() + "bet: " + bet.toString());
	}

	public void saveMove(Integer id, String move) {

		writer.println("Player " + id.toString() + "move: " + move);
	}

	public void savePot(Integer pot) {

		writer.println("Pot: " + pot.toString());
	}

	public void saveRole(Integer id, String role) {

		writer.println("Player " + id.toString() + "role: " + role);
	}

	public void saveCards(Integer id, String cards) {

		writer.println("Player " + id.toString() + "cards: " + cards);
	}
}